package top.csy8888.placeorder.web;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.*;
import top.csy8888.placeorder.common.result.ResultVO;
import top.csy8888.placeorder.entity.Goods;
import top.csy8888.placeorder.mapper.GoodsMapper;
import top.csy8888.placeorder.service.OrderService;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author CSY
 * @date 2025 - 09 - 28
 */
@RestController
@RequestMapping("/api/v1")
@RequiredArgsConstructor
@Slf4j
public class OrderController {
    private final OrderService orderService;

    @PostMapping("/order/{gid}")
    public ResultVO createOrder(@PathVariable("gid") int gid){
        orderService.placeOrder(gid);
        return ResultVO.success();
    }
}
